/* 全局样式 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Arial", sans-serif;
  line-height: 1.6;
  color: #333;
  background-color: #f5f5f5;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}
.container h1 {
    text-align: center;
}
h1,
h2,
h3 {

  margin-bottom: 20px;
  color: #2c3e50;
}

a {
  text-decoration: none;
  color: #3498db;
}

a:hover {
  text-decoration: underline;
}

/* 按钮样式 */
.btn {
  display: inline-block;
  padding: 10px 15px;
  background-color: #3498db;
  color: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  text-decoration: none;
  font-size: 14px;
  transition: background-color 0.3s;
}

.btn:hover {
  background-color: #2980b9;
  text-decoration: none;
}

.btn-secondary {
  background-color: #95a5a6;
}

.btn-secondary:hover {
  background-color: #7f8c8d;
}

.btn-danger {
  background-color: #e74c3c;
}

.btn-danger:hover {
  background-color: #c0392b;
}

.btn-small {
  padding: 5px 10px;
  font-size: 12px;
}

/* 表单样式 */
.form {
  background-color: #fff;
  padding: 20px;
  border-radius: 5px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  max-width: 600px;
  margin: 0 auto;
}

.form-group {
  margin-bottom: 15px;
}

.form-group label {
  display: block;
  margin-bottom: 5px;
  font-weight: bold;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: #3498db;
}

/* 消息样式 */
.error-message {
  background-color: #f8d7da;
  color: #721c24;
  padding: 10px;
  border-radius: 4px;
  margin-bottom: 20px;
}

.success-message {
  background-color: #d4edda;
  color: #155724;
  padding: 10px;
  border-radius: 4px;
  margin-bottom: 20px;
}

/* 登录和注册页面 */
.login-register {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-top: 30px;
}

.links {
  margin-top: 20px;
  text-align: center;
}

/* 控制面板样式 */
.dashboard {
  display: grid;
  grid-template-areas:
    "header header"
    "sidebar content"
    "footer footer";
  grid-template-columns: 200px 1fr;
  grid-template-rows: auto 1fr auto;
  min-height: 100vh;
}

.header {
  grid-area: header;
  background-color: #2c3e50;
  color: #fff;
  padding: 15px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.header h1 {
  margin: 0;
  font-size: 24px;
  color: #fff;
}

.user-info {
  font-size: 14px;
}

.user-info a {
  color: #ecf0f1;
}

.sidebar {
  grid-area: sidebar;
  background-color: #34495e;
  color: #fff;
  padding: 20px 0;
}

.sidebar ul {
  list-style: none;
}

.sidebar ul li {
  margin-bottom: 5px;
}

.sidebar ul li a {
  display: block;
  padding: 10px 20px;
  color: #ecf0f1;
  text-decoration: none;
  transition: background-color 0.3s;
}

.sidebar ul li a:hover,
.sidebar ul li a.active {
  background-color: #2c3e50;
  text-decoration: none;
}

.content {
  grid-area: content;
  padding: 20px;
  background-color: #f5f5f5;
}

.footer {
  grid-area: footer;
  background-color: #2c3e50;
  color: #fff;
  text-align: center;
  padding: 15px;
  font-size: 14px;
}

/* 控制面板卡片 */
.dashboard-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
  margin-top: 20px;
}

.card {
  background-color: #fff;
  border-radius: 5px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  padding: 20px;
}

.card h3 {
  margin-top: 0;
  margin-bottom: 10px;
  color: #2c3e50;
}

.card p {
  margin-bottom: 15px;
  color: #7f8c8d;
}

/* 数据表格 */
.data-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 20px;
  background-color: #fff;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.data-table th,
.data-table td {
  padding: 12px 15px;
  text-align: left;
  border-bottom: 1px solid #ddd;
}

.data-table th {
  background-color: #f8f9fa;
  font-weight: bold;
  color: #2c3e50;
}

.data-table tr:hover {
  background-color: #f5f5f5;
}

/* 分页控件 */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: 20px;
}

.pagination .page-info {
  margin: 0 15px;
}

.pagination-controls {
  background-color: #fff;
  padding: 15px;
  border-radius: 5px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  margin-bottom: 20px;
}

.pagination-controls form {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  align-items: flex-end;
}

.pagination-controls .form-group {
  margin-bottom: 0;
}

.actions {
  margin-bottom: 20px;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .dashboard {
    grid-template-areas:
      "header"
      "sidebar"
      "content"
      "footer";
    grid-template-columns: 1fr;
  }

  .sidebar {
    padding: 10px 0;
  }

  .sidebar ul {
    display: flex;
    flex-wrap: wrap;
  }

  .sidebar ul li {
    margin-bottom: 0;
  }

  .sidebar ul li a {
    padding: 8px 15px;
  }

  .pagination-controls form {
    flex-direction: column;
    align-items: stretch;
  }
}

